<template>
  <div id="max">
      <div class="top">
        <div class="top-img"><img src="https://cdn.51bolema.com/img/bolema_logo_0923_white.png"/></div>
        <div class="top-teble">
          <ul>
            <router-link to="personal"><li><li>首页</li></router-link>
            <router-link to="management"><li>班级</li></router-link>
            <li>考试</li>
            <li>课程</li>
            <li>题库</li>
            <li>上课</li>
            <li>进度计划模板</li>
            <li>进度计划管理</li>
          </ul>
        </div>
        <div class="top-grzx">
          <div class="linee"></div>
          <div class="top-users">
            <div class="users-img">
            <img alt="头像" src="../assets/logo.png">
            </div>
              <Dropdown>
                     <a href="javascript:void(0)">
                       <span class="user-grxxer">管理员</span>
                     </a>
                     <Dropdown-menu slot="list">
                         <Dropdown-item>退出登录</Dropdown-item>
                     </Dropdown-menu>
               </Dropdown>
          </div>
        </div>
      </div>
      <div id="home-content">
        <div class="home-index">
          <router-view></router-view>    <!-- 最重要的标签，用来显示跳转的页面 -->
        </div>
      </div>
  </div>
</template>
<script>
// import http from '@/utils/HttpUtil.js'

	export default {
		data() {
			/* 修改密码校验 */
			const validatePass = (rule, value, callback) => {
				if (value === '') {
					callback(new Error('密码不能为空'));
				} else {
					if (this.formValidate.aginer !== '') {
						// 对第二个密码框单独验证
						this.$refs.formValidate.validateField('aginer');
					}
					callback();
				}
			};
			const validatePassCheck = (rule, value, callback) => {
				if (value === '') {
					callback(new Error('密码不能为空'));
				} else if (value !== this.formValidate.password) {
					callback(new Error('两次输入的密码不同'));
				} else {
					callback();
				}
			};
			return {
				modal1: false,
				theme3: 'light',
				percentage: 100,
				modal: false,
				labelPosition: 'top',
				formValidate: {
					password: '',
					aginer: '',
					yzm: '',

				},
				/* 修改密码校验 */
				ruleValidate: {
					password: [{
						validator: validatePass,
						tigger: 'blur',
						required: true,

					}],
					aginer: [{
						validator: validatePassCheck,
						tigger: 'blur',
						required: true,
					}],
					yzm: [{
						required: true,
						message: '验证码不能为空',
						tigger: 'blur'
					}]
				}
			}

		},
		components: {

		},
		methods: {
			/* 给通知框定义 */
			info() {
				/* info填内容 */
				this.$Message.info('该课程该进度已完成');
			},
			changeRoute (index) {
				console.log(index)
			  let map = new Map()
			  map.set('1', '/main')
			 map.set('2', '/examination')
			  let routeUrl = map.get(index)
			  this.$router.push(routeUrl)
			  }
		}
	}
</script>

<style>

  #max {
    width: 100%;
    height: 100%;
    background-color: #F5F7F9;
  }
  .top {
    width: 100%;
    height: 4.375rem;
    background-color: #138bee;
    padding-left: 10rem;
    padding-right: 10rem;
    position:fixed;
  }
  .top-img {
    width: 14.375rem;
    height: 100%;
    line-height: 4.375rem;
    vertical-align:center;
    float: left;
  }
  .top-img img {
    height: 80%;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    vertical-align: middle;
  }
  .top-teble {
    width: 48rem;
    height: 100%;
    float: left;
  }
  .top-teble ul li{
    cursor:pointer;
    height: 60px;
    margin-right: 2.5rem;
    line-height: 4.375rem;
    -webkit-font-variant-ligatures: middle;
    color: #FFFFFF;
    font-size: 1rem;
    list-style:none;
    float:left;
  }
  .top-teble ul li:hover{
        color: #fcc800;
        font-weight: 700;
        border-bottom: 3px solid #fcc800;
  }
/*  .top-teble ul li:hover{
    border-bottom: 3px solid #A0D911;
  } */
  .top-grzx {
    width: 12rem;
    height: 100%;
    float: left;
  }
  .linee {
    width: 5px;
    height: 45%;
    border-left:1px solid #FFF0F6;
    margin-top: 1.2rem;
    float: left;
  }
  .top-users {
  margin-left: 3.125rem;
  padding: 0;
  width: 8rem;
  height: 100%;
  float:left;
  }
  .users-img {
    width: 4.375rem;
    height: 100%;
  }
  .users-img img {
  width: 2.1875rem;
  height: 2.1875rem;
  line-height: 1;
  font-size: .18rem;
  color: #138bee;
  background-color: #fff;
  border-radius: 50%;
  margin-top: 1.1rem;
  float: left;
  }
  .user-grxxer {
    position: absolute;
    top: -30px;
    left: -80px;
    font-size: 12px;
    color: #FFFFFF;
  }
  #home-content {
    width: 100%;
    height: 100%;
    padding-top: 5.3125rem;
  }
  .home-index {
    margin: auto;
    width: 75rem;
    height: 106.25rem;
  }
</style>
